package com.example.demo.controller;

import com.example.demo.properties.GirlProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

/**
 * 各种请求方法
 * Created by Administrator on 2017/7/5.
 */
@RestController
//@RequestMapping("/hello")
public class HelloController {

    @Value("${cupSize}")
    private String cupSize;

    @Value("${content}")
    private String content;

    @Value("${ron.ran}")
    private String ram;

    @Autowired
    private GirlProperties girlProperties;

    @RequestMapping(value={"/he/{id}","/hi"},method = RequestMethod.GET)
    public String say(@PathVariable("id") Integer id){
//        return content;
//        return girlProperties.getCupSize();
        return "index";
//        return "id:"+cupSize+"+"+ram;
    }

//    @GetMapping
//    @PostMapping
    @RequestMapping(value={"/hello","/hi"},method = RequestMethod.GET)
    public String say1(@RequestParam(value = "id",required = false,defaultValue = "0") Integer myId){
//        return content;
//        return girlProperties.getCupSize();
//        return "index";
        return "id:"+myId;
    }
}
